// vite.config.js
import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'

export default defineConfig({
    plugins: [vue()],
    resolve: {
        alias: {
            '@': path.resolve(__dirname, './src'),
        },
    },
    server: {
        proxy: {
            '/api': {
                target: 'http://localhost:18889/auth/', // 你的后端服务地址，比如Spring Boot的地址
                changeOrigin: true,
                rewrite: (path) => path.replace(/^\/api/, '') // 去掉 /api 前缀
            }
        }
    }
})
